import React, { Component } from "react";
import axios from "axios";

export default class App extends Component {
  render() {
    return (
      <div>
        <button onClick={this.getStatusData}>获取学生数据</button>
        <button onClick={this.getCartData}>获取汽车数据</button>
      </div>
    );
  }
  getStatusData = () => {
    axios.get("/api1/students").then((res) => {
      console.log(res.data);
    });
  };
  getCartData = () => {
    axios.get("/api2/carts").then((res) => {
      console.log(res.data);
    });
  };
}
